package cn.itcast.cart.feign;

import cn.itcast.cart.dto.ShoppingCartDTO;
import cn.itcast.cart.pojo.ShoppingCart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("cart-service")
public interface CartClient {
    /**
     * 添加购物车
     * @param shoppingCartDTO
     * @return
     */
    @PostMapping("/user/shoppingCart/add")
    void add(@RequestBody ShoppingCartDTO shoppingCartDTO);

    /**
     * 清空购物车
     * @return
     */
    @PostMapping("/user/shoppingCart/delete")
    void delete(@RequestBody ShoppingCart shoppingCart);

    /**
     * 查询购物车
     * @return
     */
    @PostMapping("/user/shoppingCart/getList")
    List<ShoppingCart> list(@RequestBody ShoppingCart shoppingCart);
}